import 'package:kepu/util/http_util.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

import '../../../model/plant_detail_entity.dart';

part 'plant_detail_provider.g.dart';

@riverpod
class PlantDetailProvider extends _$PlantDetailProvider {
  @override
  FutureOr<PlantDetailData> build(int id) async {
    var resp = await DioInstance.instance().get(path: "plant/$id");
    return PlantDetailEntity.fromJson(resp.data).data ;
  }
}
